.<template>
  <div class="regisity">
       <div><input type="text" v-model="user" placeholder="用户名"></div>
      <div><input type="text" v-model="pwd" placeholder="密码"></div>
      
      <div><button @click="regisity">注册</button></div>
  </div>
</template>

<script>
import axios from 'axios'
export default {
    data () {
        return {
            user:'',
            pwd:''
        }
    },
    methods: {
        regisity(){
            axios.post('/api/regisity',{user:this.user,pwd:this.pwd}).then(res=>{
                if(res.data.code){
                    this.$router.push(`/index/home?id=${res.data.id}`)
                }
            })
        }
    }
}
</script>

<style lang='scss'>
.regisity{
     width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    input{
        width: 250px;
        height: 50px;
        margin: 5px 0;
        text-indent: 1em;
        border-radius: 10px;
        outline: none;
        border: 1px solid #ccc;
    }
    button{
        width: 225px;
        height: 40px;
        margin: 5px 0;
        background-color: cornflowerblue;
        border-radius: 10px;
        outline: none;
        border: 0;
    }
}
</style>